package main

import (
	"log"
	"time"
)

//定时器
func main() {
	ticker := time.NewTicker(time.Second * time.Duration(1))
	g := make(chan int)
	go func() {
		for {
			select {
			case <-ticker.C:
				log.Println(time.Now().Unix())
			}
		}
	}()
	<-g
}
